import request from '@/utils/request'

// 查询仓库员工信息列表
export function listWarehouseStaff(query) {
  return request({
    url: '/wms/warehouseStaff/list',
    method: 'get',
    params: query
  })
}

// 查询仓库员工信息详细
export function getWarehouseStaff(id) {
  return request({
    url: '/wms/warehouseStaff/' + id,
    method: 'get'
  })
}

// 新增仓库员工信息
export function addWarehouseStaff(data) {
  return request({
    url: '/wms/warehouseStaff',
    method: 'post',
    data: data
  })
}

// 修改仓库员工信息
export function updateWarehouseStaff(data) {
  return request({
    url: '/wms/warehouseStaff',
    method: 'put',
    data: data
  })
}

// 删除仓库员工信息
export function delWarehouseStaff(id) {
  return request({
    url: '/wms/warehouseStaff/' + id,
    method: 'delete'
  })
}

// 根据用户ID查询仓库员工信息
export function getWarehouseStaffByUserId(userId) {
  return request({
    url: '/wms/warehouseStaff/user/' + userId,
    method: 'get'
  })
}

// 根据仓库ID查询仓库员工信息
export function getWarehouseStaffByWarehouseId(warehouseId) {
  return request({
    url: '/wms/warehouseStaff/warehouse/' + warehouseId,
    method: 'get'
  })
}

// 根据部门查询仓库员工信息
export function getWarehouseStaffByDepartment(department) {
  return request({
    url: '/wms/warehouseStaff/department/' + department,
    method: 'get'
  })
}

// 检查用户是否已分配仓库
export function checkUserWarehouseAssignment(userId, warehouseId) {
  return request({
    url: '/wms/warehouseStaff/check',
    method: 'get',
    params: {
      userId: userId,
      warehouseId: warehouseId
    }
  })
}

// 导出仓库员工信息
export function exportWarehouseStaff(query) {
  return request({
    url: '/wms/warehouseStaff/export',
    method: 'get',
    params: query
  })
}